Primary resource for the activity. For activities that do not have a resource, this returns null.
Parent Type: ActivityNodeReader
Namespace: Microsoft.LearningComponents.Manifest
Assembly: Microsoft.LearningComponents.dll
| C# |
|
public ResourceNodeReader Resource { get; } |
| Exception type | Condition |
| InvalidPackageException | The parsing mode is |
If there is no resource associated with this activity, this property returns null. In SCORM 2004 packages, if the activity has a resource and also has child <item> nodes, this property will throw an InvalidPackageException in ManifestReaderSettings.FixScormRequirementViolations=false.
If parsing mode is ManifestReaderSettings.FixScormRequirementViolations=true and the activity has an identifierref attribute, but no matching resource can be found, a warning is issued to the log and null is returned.
Given an ActivityNodeReader, iterate through the resources for all the child activities.
| C# |
foreach (ActivityNodeReader child in activity.ChildActivities)
{
ResourceNodeReader resource = child.Resource;
if (resource != null)
{
// Use the ResourceNodeReader
}
}
|